<div class="container">
	<div class="row row-offcanvas row-offcanvas-right">
		<ol class="breadcrumb">
			<li>Tìm thấy <?=$this->paginator->getTotalItemCount()?> kết quả </li>
		</ol>
		<div class="col-xs-12 col-sm-9">
			<p class="pull-right visible-xs">
				<button type="button" class="btn btn-primary btn-xs"
					data-toggle="offcanvas">Toggle nav</button>
			</p>

			<!-- Display phones -->
			<?php if ($this->paginator->getTotalItemCount() > 0) {?>
			<div class="row">
				<?php foreach ($this->paginator as $phone) {?>
				<div class="col-6 col-sm-6 col-lg-4">
					<p>
						<a href="<?=WEB_PATH?>/phone/detail/id/<?=$phone->id ?>"> 
						<img alt="" src="<?=WEB_PATH?>/public/imgs/<?=$phone->image_url?>" class="img-max-width">
						</a> <span><?=$phone->name ?></span> <br /> 
						<span id="phone-price"><?=$phone->price ?></span> <br/>	
						<a class="btn btn-default" href="<?=WEB_PATH?>/phone/detail/id/<?=$phone->id ?>">Chi Tiết &raquo;</a>
						<a class="btn btn-success" href="<?=WEB_PATH?>/customer/addtocart/id/<?=$phone->id ?>">Mua hàng</a>
					</p>
				</div>
				<!--/span-->
				<?php }?>
			</div>
			<?php }else { ?>
				<h4>Không tìm thấy</h4>
			<?php }?>
			<!--/row-->

			<!-- Pagination -->
			<?php if ($this->paginator->getPages()->pageCount > 1) {?>
			<div class="text-center">
				<ul class="pagination" id="pagination">
				  <?php $currentPage = $this->paginator->getCurrentPageNumber();?>
				  <li class="<?=$currentPage == 1 ? 'disabled' : '' ?>"><a
						href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$currentPage - 1?>">&laquo;</a></li>
				  <?php for($i = 1; $i<= $this->paginator->getPages()->pageCount; $i++) {?>
				  	<li class="<?=$currentPage == $i ? 'active' : '' ?>"><a
						href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$i?>"><?=$i?></a></li>
				  <?php }?>
				  <li
						class="<?=$currentPage == $this->paginator->getPages()->pageCount? 'disabled' : '' ?>"><a
						href="<?=WEB_PATH?>/index/catagory/id/<?=$this->currentCatagory->id?>/page/<?=$currentPage + 1?>">&raquo;</a></li>
				</ul>
			</div>
			<?php }?>
		</div>
		<!--/span-->
		
		<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"
		role="navigation">
		<div class="well sidebar-nav">
			<form action="<?=WEB_PATH?>/search/advancesearch" method="post">
				<ul class="nav">
					<li>Advance Search</li>
					<li><input name="search-name" type="text" class="form-control"
						placeholder="phone's name"></li>
					<li>Price from:</li>
					<li><input id="min-price" name="min-price" type="hidden" value="5000000"></li>
					<li>To:</li>
					<li><input id="max-price" name="max-price" type="hidden" value="15000000"></li>
					<li><button type="submit" class="btn btn-default">Search</button></li>
				</ul>
			</form>
		</div>
		<!--/.well -->
	</div>
	<!--/span-->
	</div>
	<!--/row-->

	
	<hr>

	<footer>
		<p>&copy; Company 2013</p>
	</footer>
</div>
<!--/.container-->
